Skip to main content

/close_shift

Request body:

FieldTypeRequiredFormat / constraints
employeeNamestringNoCashier name
openOrdersOperationstringNoSee value map below
genPreviewbooleanNoIf true, requests a fiscal receipt preview (see preview_data in the response)

Specific values:

  • openOrdersOperation = delete: delete unclosed orders and continue closing shift.
  • openOrdersOperation = renew: transfer unclosed orders and continue closing shift.
  • openOrdersOperation = check or missing: do not force action, return error (code = 24, SHIFT_HAS_OPEN_DOCS) if unclosed orders exist.
  • Any other value is treated the same as check.

If openOrdersOperation is delete or renew and the delete/transfer of unclosed checks itself fails (forbidden by cashbox settings, a check could not be deleted because it has a terminal payment, or a lower-level delete/transfer error), the response has no code field (or code: null) — this is a known business-rule error, not an unexpected failure, so the client should show message to the user as-is. Where possible message names the specific check that is blocking the close (e.g. by its receipt number); when the whole operation is forbidden by settings, no specific check is named. See §12.3 for the general rule behind the missing code.

Success response:

FieldTypeRequiredNotes
shiftIDinteger (int32)NoShift id
fiscalShiftIDstringNoFiscal shift id
fiscalShiftNumstringNoFiscal shift number
shiftOpenAtstringNoShift open time
cashinteger (int64)NoCash balance
saleCountinteger (int32)NoSale count
saleSuminteger (int64)NoSale sum
saleCashSuminteger (int64)NoCash sale sum
saleCashlessSuminteger (int64)NoCashless sale sum
saleCreditSuminteger (int64)NoCredit sale sum
saleBonusSuminteger (int64)NoBonus sale sum
saleVatAmountsarray of VAT entriesNoSale VAT totals
depositCountinteger (int32)NoDeposit count
depositSuminteger (int64)NoDeposit sum
withdrawCountinteger (int32)NoWithdraw count
withdrawSuminteger (int64)NoWithdraw sum
moneyBackCountinteger (int32)NoRefund count
moneyBackSuminteger (int64)NoRefund sum
moneyBackCashSuminteger (int64)NoCash refund sum
moneyBackCashlessSuminteger (int64)NoCashless refund sum
moneyBackCreditSuminteger (int64)NoCredit refund sum
moneyBackBonusSuminteger (int64)NoBonus refund sum
moneyBackVatAmountsarray of VAT entriesNoRefund VAT totals
currency_namestringNoCurrency
fiscalDatastringNoFiscal raw data JSON, when available
preview_datastringNoReceipt/report preview text; present only when genPreview=true was requested
openOrdersOperationstringNoEchoes the request's openOrdersOperation value